package rc.alfresco.users;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import rc.alfresco.users.dao.RcUserDao;
import rc.alfresco.users.dao.RcUserDaoIbatis;
import rc.alfresco.users.dto.RcUserTEO;

import java.io.Reader;
import java.util.Properties;

/**
 * Created by IntelliJ IDEA.
 * User: Slejus
 * Date: 13.11.26
 * Time: 14.02
 * To change this template use File | Settings | File Templates.
 */
public class TestMain {

    private static Properties props = new Properties();

    public static void main(String[] args) throws Exception
    {
        RcUserDao manager = new RcUserDaoIbatis();
        /*
        props.put("driver","oracle.jdbc.driver.OracleDriver");
        props.put("url","jdbc:oracle:thin:@kadadev.kada.lan:1521:kadadev");
        props.put("JDBC.Username", "alfresco");
        props.put("JDBC.Password", "E4fc6b54");
        */
        Reader reader = Resources.getResourceAsReader("sql-maps-config.xml");
        SqlMapClient sqlmapClient = SqlMapClientBuilder.buildSqlMapClient(reader,props);

        RcUserTEO user = new RcUserTEO();
        user = manager.getUserByAmnId(17426579,sqlmapClient);
        props.clear();

    }
}
